package com.dev.mainual.throwable.ssm;

import com.sun.org.apache.regexp.internal.RE;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * ClassName: Result
 * Description:
 * Date: 2019/1/28 12:39 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
@Setter
@Getter
public class Result<T> {

    public static final boolean SUCCESS = true;
    public static final boolean FAILURE = false;

    private boolean success = SUCCESS;
    private int code;
    private String msg;
    private List<T> data;

    public Result() {
    }

    public Result(boolean success) {
        this.success = success;
    }

    public Result(String msg) {
        this.msg = msg;
    }

    public static Result ok() {
        return new Result();
    }

    public static Result error() {
        return new Result(false);
    }

}
